package com.bonc.modules.rpt.controller;

import com.bonc.common.param.BaseParam;
import com.bonc.common.utils.Result;
import com.bonc.modules.rpt.entity.PeakShavingEntity;
import com.bonc.modules.rpt.service.impl.PeakShavingDeptServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author jinlong
 * @date 2021/8/4
 */
@Controller
@RequestMapping("/rpt/peakShaving")
public class PeakShavingController {


    @Autowired
    private PeakShavingDeptServiceImpl peakShavingDept;


    @GetMapping("/getDept")
    @ResponseBody
    public Result getDept() {
        List<String> dept = peakShavingDept.getDept();
        return Result.ok().put("list", dept);
    }

    /**
     * 获取图数据
     *
     * @return
     */
    @PostMapping("/getChartData")
    public Result getChartData(@RequestBody @Validated(BaseParam.list.class) PeakShavingEntity peakShavingEntity) {
        return Result.ok();
    }

}
